package com.aiou.security.authentication.mobile;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @author zyb
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SmsUser extends User implements SmsUserDetails {

	private static final long serialVersionUID = 1L;
	private String mobile;

	public SmsUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
	}

	public SmsUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
		super(username, password, authorities);
	}

	@Override
	public String getMobile() {
		return getUsername();
	}

}